package com.blockchain.nodes.manager.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.blockchain.nodes.manager.mapper.NodesConfigMapper;
import com.blockchain.nodes.manager.domain.NodesConfig;
import com.blockchain.nodes.manager.service.INodesConfigService;
import com.blockchain.nodes.common.support.Convert;

/**
 * 节点配置 服务层实现
 * 
 * @author Gene Max
 * @date 2019-03-08
 */
@Service
public class NodesConfigServiceImpl implements INodesConfigService 
{
	@Autowired
	private NodesConfigMapper nodesConfigMapper;

	/**
     * 查询节点配置信息
     * 
     * @param id 节点配置ID
     * @return 节点配置信息
     */
    @Override
	public NodesConfig selectNodesConfigById(Integer id)
	{
	    return nodesConfigMapper.selectNodesConfigById(id);
	}
	
	/**
     * 查询节点配置列表
     * 
     * @param nodesConfig 节点配置信息
     * @return 节点配置集合
     */
	@Override
	public List<NodesConfig> selectNodesConfigList(NodesConfig nodesConfig)
	{
	    return nodesConfigMapper.selectNodesConfigList(nodesConfig);
	}
	
    /**
     * 新增节点配置
     * 
     * @param nodesConfig 节点配置信息
     * @return 结果
     */
	@Override
	public int insertNodesConfig(NodesConfig nodesConfig)
	{
	    return nodesConfigMapper.insertNodesConfig(nodesConfig);
	}
	
	/**
     * 修改节点配置
     * 
     * @param nodesConfig 节点配置信息
     * @return 结果
     */
	@Override
	public int updateNodesConfig(NodesConfig nodesConfig)
	{
	    return nodesConfigMapper.updateNodesConfig(nodesConfig);
	}

	/**
     * 删除节点配置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteNodesConfigByIds(String ids)
	{
		return nodesConfigMapper.deleteNodesConfigByIds(Convert.toStrArray(ids));
	}
	
}
